home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE4 / ZAP / !Zap / Modules / !ZapSAsm / !Help next >
Text File  |  2002-05-08  |  15KB  |  351 lines

  1.  ____________________                       ____________________
  2.  ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ##| ##|  ######|  ##|    #####| ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
  3.               ##| ##|  ##|¯¯¯    ##|    ##|¯##|
  4.               ##| ##|  ##|    ##|    ##| ##|
  5.               ######|  #####|    ##|    #####|
  6.               ##|¯##|  ##|¯¯    ##|    ##|¯¯
  7.               ##| ##|  ##|    ##|    ##|
  8.  ____________________ ##| ##|  ######|  #####|  ##| _______________________
  9.  ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¯¯  ¯¯   ¯¯¯¯¯¯    ¯¯¯¯¯    ¯¯  ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
  10.  ——————————————————————————————————————————————————————————————————————————
  11.    ZapSAsm                       Version 1.04 (21 May 1995)
  12.  ——————————————————————————————————————————————————————————————————————————
  13.        This application is © 1995 James Freeman. All Rights Reserved.
  14.  
  15.           It is FREEWARE. Use is at your own risk.
  16.          Please read the conditions at the end of this file.
  17.  
  18.  −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
  19.   G E N E R A L      I N F O R M A T I O N
  20.  ——————————————————————————————————————————————————————————————————————————
  21.          Sattinger’s Law: It works better if you plug it in.
  22.  ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– Arthur Bloch
  23.  
  24.  Program:  ZapSAsm
  25.  
  26.  Purpose:  Extension mode and utilities for Zap.
  27.  
  28.  Requires: Tested on RISC OS 3.1x and later.
  29.         (Read: it may work on RISC OS 2, but then again...)
  30.        Zap 1.23 or later.
  31.         (ZapSAsm will function with Zap 1.20 but, because of a little
  32.         bug in Zap, two of the colours will be incorrectly rendered.)
  33.  
  34.  Features: • Module takes up only 4980 bytes.
  35.        • Hand-written in ARM code.
  36.        • Text-based colour extension mode for SAsm source files.
  37.        • Several mode-independent Zap commands.
  38.        • Links Zap with WordWorks (not included :-).
  39.  
  40.  
  41.  −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
  42.   W H O ?   W H A T ?    W H E N ?   H O W ?
  43.  ——————————————————————————————————————————————————————————————————————————
  44.        It ain’t what a man don’t know that makes him a fool,
  45.             but what he does know that ain’t so.
  46.  –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– Josh Billings
  47.  
  48.  This program was written in ARM using Zap 1·25 and SAsm 1·60. My thanks
  49.  to Dominic Symes (now, remind me, who’s that bloke again and what’s he
  50.  written that everyone’s fussing over?) and David Radford for putting
  51.  these programs into the public domain.  SAsm is shareware and written
  52.  by David Holden.
  53.  
  54.  I give no guarantee that this program will work correctly on all machines
  55.  and all configurations - but it works for me.  Take it or leave it.
  56.  
  57.  
  58.  −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
  59.   S U M M A R Y
  60.  ——————————————————————————————————————————————————————————————————————————
  61.           Nothing is so useless as a general maxim.
  62.  –––––––––––––––––––––––––––––––––––––––––––––––––––––––––– Thomas Macaulay
  63.  
  64.  This directory contains:
  65.  
  66.  !Help.*                   Help text and reader.
  67.  DemoText                   Demonstration text.
  68.  Impulse                   Impulse methods (text).
  69.  ZapSAsm                   Extension module.
  70.  
  71.  So, you’ve seen a colour Acorn C mode on Zap.
  72.  Oh, and a colour BASIC mode.
  73.  And you’ve seen a colour Acorn Assembler mode.
  74.  But have you seen a colour SAsm mode?  No?  Guess what this is.
  75.  
  76.  If you’ve got David Holden’s excellent SAsm assembler, then this mode’s
  77.  for you.  If you haven’t, then hold your horses - there are a few commands
  78.  you might find useful instead, as well as support for CC’s WordWorks.
  79.  
  80.  For installation instructions, go down right to the end of this section.
  81.  
  82.  
  83.  THE EXTENSION MODE
  84.  ==================
  85.  
  86.  The SAsm mode provides the following additional colours:
  87.  
  88.   • Labels
  89.     Definitions (ie. ‘.labelname’) - not references from (eg.) branches.
  90.  
  91.   • Macros
  92.     Both expanded macro and macro function calls are recognised.
  93.  
  94.   • Immediates
  95.     Only if preceded by hash (‘#’).  This means that the enhanced second
  96.     operand feature of SAsm (for ‘CMP’, ‘MOV’, ‘TST’ and ‘TEQ’) is not
  97.     recognised.  (The reason it isn’t currently implemented is because it
  98.     only applies to those four mnemonics; I’ve already written the code for
  99.     it, but it operates on all the second operands...)  In addition, the
  100.     equates ‘EQUB’, ‘EQUW’, ‘EQUD’, ‘EQUS’, ‘DCB’, ‘DCW’, ‘DCD’, ‘DB’,
  101.     ‘DW’, and ‘DB’ are recognised as being followed by an immediate
  102.     constant.
  103.  
  104.   • Strings
  105.     Anything within double quotation marks which isn’t a comment.
  106.  
  107.   • Comments
  108.     Both ‘;’ (with checks, to allow ‘#PRINT"blah";’) and ‘\’ are supported.
  109.     I do not recognise ‘REM’.  (You honestly don’t use this for assembler
  110.     do you?  Oh dearie me...  If anyone requests, I’ll probably add it.)
  111.  
  112.   • Directives
  113.     And lines passed to BASIC (ie. lines which begin with a hash).
  114.  
  115.   • Operands1
  116.     Anything after the mnemonic which isn’t an immediate, string, comment
  117.     or displayed in the ‘Operands2’ colour.
  118.  
  119.   • Operands2
  120.     The following characters within the operand are displayed in this
  121.     colour: ‘[’, ‘]’, ‘{’, ‘}’, ‘(’, ‘)’, ‘!’, ‘^’, ‘-’ and ‘,’.
  122.  
  123.   • Shifts
  124.     Now, and as if you couldn’t guess, the shifts (that’s ‘LSL’, ‘LSR’,
  125.     ‘ASL’, ‘ASR’, ‘ROR’ and ‘RRX’ in case you didn’t realise) are displayed
  126.     in this colour.
  127.  
  128.  Remember though: just because you’ve got so many *logical* colours doesn’t
  129.  mean they all have to be different *physical* colours.  Of course, if you
  130.  like your source code looking like a rainbow, that’s your decision :-)
  131.  
  132.  And another thing: SAsm should produce proper colours for SAsm source
  133.  textfiles.  If you load non-SAsm sources, etc, you are likely to find that
  134.  the colouring goes a bit awry.  Remember, it is expecting text in the
  135.  correct syntax for SAsm.  (Oh really?)
  136.  
  137.  
  138.  STILL TO BE IMPLEMENTED
  139.  =======================
  140.  
  141.   • Enhanced second operand detection for CMP/MOV/TEQ/TST.
  142.  
  143.   • REM recognition.
  144.  
  145.   • SWI name processing (#swion).
  146.  
  147.   • Non-local labels allowed after colons.
  148.  
  149.   • Multi-line features (very difficult!): {} comments, #end, #area.
  150.  
  151.  
  152.  PROBLEMS / FUTURE PLANS
  153.  =======================
  154.  
  155.   • With lines longer than the width of the window, the part(s) which wrap
  156.     round are not coloured correctly.
  157.  
  158.   • There’s also a problem if the text goes right up to the right hand side
  159.     of the window.
  160.  
  161.  
  162.  OTHER FEATURES OF THE SASM MODE
  163.  ===============================
  164.  
  165.  The following are entry points for the SAsm mode:
  166.  
  167.   • The ‘COMPILE’ and ‘SAVEANDRUN’ entry points save the source file you’re
  168.     editing and run the file ‘!!Make’ in the same directory as the source.
  169.     (Hint: I use a TaskObey (&FD7) file which *REMOVEs any error files etc,
  170.     then runs SAsm giving it the filename of the ‘!Make’ file in the same
  171.     directory - this second file is a textfile consisting of various
  172.     directives (eg. #VERBOSE, #ERRFILE) and then a list of #INCLUDEs for
  173.     my source files, constants files and function definition files.)
  174.  
  175.   • The ‘RUN’ and ‘RUNANDQUIT’ entry points run the ‘!!Make’ file without
  176.     first saving the source.  (Provided for completeness because it was
  177.     very easy to do .. I don’t know what you’d need it for though.)
  178.  
  179. BTW - the mode sets ‘SAsm$Dir’ to the directory containing ‘!!Make’.
  180.  
  181.   • The ‘LISTFNS’ entry point searches for all uncommented expanded macros
  182.     and macro function definitions.  It simply begins a search for the
  183.     string ‘\<\(\I\|\&20\)\*\(\&23\( \)\*\-sm\|\+DEF\( \)\*\+FN\)’.
  184.  
  185.  Given the way SAsm handles wildcarded source filenames, you will probably
  186.  find the ‘DECANDSAVE’ command (below) useful.  (I use it all the time.)
  187.  
  188.  
  189.  COMMUNICATING WITH WORDWORKS
  190.  ============================
  191.  
  192.  While Computer Concepts’ Impulse module is installed, the following
  193.  features are available from ZapSAsm:
  194.  
  195.   • The command ‘WORDWORKS’ sends the Impulse method ‘NewRegion’ together
  196.     with the current selection (in Zap) to all Impulse tasks.  If you have
  197.     Computer Concepts’ WordWorks application loaded, this message is
  198.     recognised by it, and it will try to find the word/phrase in the
  199.     dictionary/thesaurus.  If there is no selection in Zap, this command
  200.     will have no effect.
  201.  
  202.   • ZapSAsm supports the Impulse method ‘Enter’ (sent by WordWorks), which
  203.     enters the supplied text into the current window.  If there is a
  204.     selection in Zap in the same *file* as the current window (but not
  205.     necessarily the same window), the text replaces the selected text.
  206.  
  207.  Note that ZapSAsm is not ‘intelligent’, in the sense that it will not
  208.  check your grammar!  That is to say - if you send ‘enters’ to WordWorks,
  209.  it will bring up a display on ‘enter’; if you then choose the alternative
  210.  word ‘insert’ from the thesaurus and replace it in your Zap document, it
  211.  puts ‘insert’ there - and not ‘inserts’.
  212.  
  213.  
  214.  OTHER COMMANDS
  215.  ==============
  216.  
  217.  The following are commands available from any mode:
  218.  
  219.   • The ‘INCVERSION’ command increments the version number of the current
  220.     file.  In other words, if the leafname is ‘Source5’ then it’s changed
  221.     to ‘Source6’.  This wraps round, so ‘File9’ becomes ‘File0’ (rather
  222.     than ‘File10’).
  223.  
  224.   • The ‘INCANDSAVE’ command increments the version number of the current
  225.     file and then saves it under the new filename.
  226.  
  227.   • The ‘DECVERSION’ command decrements the version number of the current
  228.     file.  In other words, if the leafname is ‘Source35’ then it’s changed
  229.     to ‘Source34’.  This wraps round, so ‘File000’ becomes ‘File999’.
  230.  
  231.   • The ‘DECANDSAVE’ command decrements the version number of the current
  232.     file and then saves it under the new filename.
  233.  
  234.   • The ‘LOSECARET’ command removes the caret from Zap.
  235.  
  236.   • The ‘LISTLABELS’ command searches for uncommented labels in the current
  237.     file.  It simply begins a search for the string ‘\<\( \|\I\)\*.\.\.\*’.
  238.  
  239.   • The ‘WOSCLI’ command sends its string parameter to OS_CLI (via
  240.     Wimp_StartTask).  (Note that Zap’s ‘OSCLI’ command works differently;
  241.     it sends the *command’s output to a scrapfile, then opens a window on
  242.     that file.  ‘WOSCLI’ on the other hand just shows any vdu output in
  243.     a regular non-multi-tasking Wimp command window.)
  244.  
  245.  
  246.  
  247.  INSTALLATION
  248.  ============
  249.  
  250.  Copy the !ZapSAsm application into the !Zap.Modules directory, then
  251.  restart Zap.
  252.  
  253.  −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
  254.   P R O G R A M      H I S T O R Y
  255.  ——————————————————————————————————————————————————————————————————————————
  256.          The World Record holder for blowing a bugle whilst
  257.           riding a bike uphill dragging four hundredweight
  258.          of pig iron and holding his breath is buried at...
  259.  ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– Spike Milligan
  260.  
  261.  1.00 First version for Zap 1·20.
  262.  1.01 A few bug fixes later.  It might just work :-)
  263.  1.02 No, it most definitely won’t :-(  And I’m just doing a couple of bug
  264.       fixes when I notice my text-wrapping problem (see above).  Aaargh!
  265.       OK, it’s way from perfect, but it’ll have to suffice for a while.
  266.  1.03 But it only sufficed for a very little while.  Fingers crossed...
  267.  1.04 Another bug fixed after testing with Zap 1.27...
  268.       FIRST RELEASE VERSION, emailed to Dom.
  269.  
  270.  
  271.  −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
  272.   L A S T   W O R D S
  273.  ——————————————————————————————————————————————————————————————————————————
  274.        Die, my dear doctor? That’s the last thing I shall do.
  275.  ––––––––––––––––––––––––––––––––––––––––––––––––– Lord Palmerston (Attrib)
  276.  
  277.   • IMPORTANT legal notes: please read.  If you cannot comply with the
  278.     following, please delete this software package immediately.
  279.     —−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—
  280.     (1) Definitions:
  281.     'Package' means the 'ZapSAsm' module and all the files connected with
  282.     this module.
  283.     'The Author' means Mr James P Freeman.
  284.     'Freeware' means freely distributable in the sense that no profit is
  285.     made from the distribution of the package, and that the contents of the
  286.     package remain the copyright of the relevant author(s).  The extent to
  287.     which the contents are copyright The Author is given in section (2).
  288.     —−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—
  289.     (2) Extent:
  290.     All files within this package are © copyright The Author.
  291.     The exception(s) above is/are subject to the same distribution
  292.     conditions unless stated otherwise here or elsewhere: in other words,
  293.     it/they should be distributed alongside the The Author's files.
  294.     —−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—
  295.     (3) Distribution conditions:
  296.     This package is Freeware.  You may give a copy to anyone but there must
  297.     be no charge.  For so-called 'Public Domain' and 'Shareware' libraries,
  298.     a small fee for the cost of discs, postage and administration is
  299.     allowed, provided that the cost of the disc upon which this package is
  300.     included is NOT MORE THAN UK£1·75 for an 800K disc, or £2·50 for a
  301.     1600K disc.  This package must be distributed in a COMPLETE and
  302.     UNALTERED state.  Distribution on a magazine disc or other than as
  303.     described here may only be undertaken with The Author's express advance
  304.     written permission.
  305.     —−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—
  306.     (3a) Special distribution conditions:
  307.     Although this package may be copied alone subject to the above terms,
  308.     it is specifically designed to be internal to Dominic Symes' Zap
  309.     editor.  Where it is supplied with Zap, that application's distribution
  310.     conditions apply and section (3) should be construed so as to accord
  311.     with those conditions.  If any part of section (3) is inconsistent with
  312.     those conditions, the latter prevail.
  313.     —−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—
  314.     (4) Other conditions:
  315.     THIS PACKAGE IS SUPPLIED 'AS IS'.  USE IS ENTIRELY AT THE USER'S OWN
  316.     RISK.  It carries no warranty, express or implied.  No guarantee is
  317.     given of even the implied terms of satisfactory quality or suitability
  318.     for purpose.  The Author accepts no responsibility whatsoever for this
  319.     package and under no circumstances will be liable, in negligence or
  320.     otherwise, for any damage (whether physical or economic), including but
  321.     not restricted to direct, incidental and consequential loss, arising
  322.     through, or in any way connected with, the use or misuse of this
  323.     package or any files or routines contained therein - even if The Author
  324.     has been advised of the possibility of such loss.  The Author reserves
  325.     the right to amend this notice and/or alter the distribution conditions
  326.     of this software package at any time.
  327.     —−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—−—
  328.  
  329.   • PLEASE NOTE THAT THIS PROGRAM IS NOT PUBLIC DOMAIN.
  330.  
  331.     Any bug reports or missing commands should be sent to 
  332.   
  333.         bugs@zap.tartarus.org
  334.         
  335.     Feature requests should be directed towards
  336.   
  337.           zap-features@zap.tartarus.org
  338.  
  339.  
  340. There are a also a number of mailing lists you can subscribe to - see
  341. Zap's web pages for details:
  342.  
  343.         http://zap.tartarus.org/
  344.  
  345.  
  346.  −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
  347.   E R R A T U M
  348.  ——————————————————————————————————————————————————————————————————————————
  349.           This slip has been inserted by mistake.
  350.  –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– Alisdair Gray
  351.